﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="ValidationOps_Default" Title="BizTalk Server Administration Web Console - Schema Validation" StylesheetTheme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script language="javascript" type="text/javascript">
    function CheckBoxListSelect(cblControl, state)
    {    
        var chkBoxList = document.getElementById(cblControl);
        var chkBoxCount = chkBoxList.getElementsByTagName("input");
        for (var i=0; i < chkBoxCount.length; i++) 
            chkBoxCount[i].checked = state;
    }
    </script>

    <asp:Label ID="lblPageHeader" runat="server" CssClass="PageHeader" Text="Schema Validation" /><br />
    <strong>Applications:</strong>
    <asp:DropDownList ID="ddlApps" runat="server" AutoPostBack="True" DataSourceID="ApplicationDS"
        DataTextField="Name" DataValueField="Name" AppendDataBoundItems="True">
        <asp:ListItem Text="Select..." Value="" />
    </asp:DropDownList>
    <br />
    <br />
    <asp:Panel ID="pnlSchemaList" runat="server" Visible="false">
        <table border="0" cellspacing="0" cellpadding="5" width="50%">
            <tr>
                <td valign="top">
                    <asp:CheckBox ID="chkAll" runat="server" AutoPostBack="True" EnableViewState="False"
                        Text="Select All" Font-Bold="True" />
                    <asp:CheckBoxList ID="chkSchemas" runat="server" DataSourceID="SchemaDS" DataTextField="FullName"
                        DataValueField="FullName" AppendDataBoundItems="True" OnSelectedIndexChanged="chkSchemas_SelectedIndexChanged">
                    </asp:CheckBoxList></td>
                <td valign="top">
                    <asp:FileUpload ID="TestFileUpload" runat="server" EnableViewState="False" /><br />
                    <asp:Button ID="btnValidate" runat="server" Text="Validate Schema" OnClick="btnValidate_Click" /></td>
            </tr>
        </table>
    </asp:Panel>
    <asp:ObjectDataSource ID="ApplicationDS" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="ListApplicationNames" TypeName="BTApplicationOperations" />
    <asp:ObjectDataSource ID="SchemaDS" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="ListDocumentSchemas" TypeName="BTSchemaOperations">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlApps" Name="applicationName" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
